#ifndef VIEW_H
#define VIEW_H

#include <QLabel>
#include <QString>
#include <QPixmap>
#include <QCheckBox>
#include <QMessageBox>

#include "Model/bimossensorpressure.h"
#include "ui_bimoscontrol.h"
#include "Control/config.h"


#define ABSOLUTE_PRESSURE_AIR 1077


class View : public QWidget
{
    Q_OBJECT



public:
    View(Ui::BimosControl* uiBimosWindow);
    Ui::BimosControl *ui;

    void initialize();

    void setupPressureTab();
    void setupHorizontalLines();
    void setupPressureTabLabels();
    QLabel* labelPressureText[16];
    QLabel* labelPressureValues[16];
    QFrame* horizontalLine[7];
    void setupEvacuateTab();
    void setupEvacuateTabLabelsAndButtons();
    QLabel* labelEvacuateText[14];
    QPushButton* btnEvacuate[14];

    void setupPrepressureTab();
    void setupPrepressureTabLabelsAndButtons();
    QLabel* labelPrepressureText[14];
    QPushButton* btnPrepressure[14];


    int plotXStep;
    int plotXRange;

    QPalette* redText;
    QPalette* normalText;


    void setNewVoltValues(int conNumber, float value);


    int showEvacuationDialog();
    int showPrepressureDialog(double pressure);


private:
    double xValue;

public slots:

    void setSensorVisible(int ordinal, bool state);
    void draw(BimosSensorPressure *sensor);
    void redraw();
    void receiveAbsolutePressureValue(double);
    void receiveTemperature(double value);


};

#endif // View_H
